package com.csun.cmny.provider.service.impl;

import com.csun.cmny.core.support.BaseService;
import com.csun.cmny.provider.dao.DmcPatrolConfigMapper;
import com.csun.cmny.provider.model.domain.DmcPatrolConfig;
import com.csun.cmny.provider.model.dto.patrol.PatroTaskPageDto;
import com.csun.cmny.provider.model.dto.patrol.PatrolTaskIdDto;
import com.csun.cmny.provider.model.vo.patrol.PatrolGreatConfigVo;
import com.csun.cmny.provider.service.DmcPatrolConfigService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2021/7/22 9:39
 * @Description: 巡更配置接口实现
 */
@Service
public class DmcPatrolConfigServiceImpl extends BaseService<DmcPatrolConfig>
        implements DmcPatrolConfigService {

    @Resource
    private DmcPatrolConfigMapper dmcPatrolConfigMapper;
    /*
     * 查询巡更任务
     * */
    @Override
    public PageInfo patrolTaskSelect(PatroTaskPageDto patroTaskPageDto) {
        List<DmcPatrolConfig> list = dmcPatrolConfigMapper.patrolTaskSelect(patroTaskPageDto);
        return new PageInfo(list);
    }
    /*
     * 删除巡更任务
     * */
    @Override
    public Integer patrolTaskDelete(PatrolTaskIdDto patrolTaskIdDto) {
        return dmcPatrolConfigMapper.patrolTaskDelete(patrolTaskIdDto);
    }
    /*
     * 修改巡更任务
     * */
    @Override
    public Integer patrolTaskUpdate(DmcPatrolConfig dmcPatrolConfig) {
        return dmcPatrolConfigMapper.patrolTaskUpdate(dmcPatrolConfig);
    }

    /**
     * 查询巡更棒的配置
     *
     * @param groupId   the group id
     *
     * @return  the patrol great config vo list.
     */
    @Override
    public List<PatrolGreatConfigVo> queryConfigByGroupId(Long groupId) {

        return dmcPatrolConfigMapper.queryConfigByGroupId(groupId);
    }

}
